package com.justgame.project.service.api.entity;

import com.justgame.project.cloud.common.entity.BaseEntity;
import com.justgame.project.cloud.common.constant.Regex;
import com.justgame.project.cloud.common.constant.ValidGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.groups.Default;

@Data
@EqualsAndHashCode(callSuper = true)
public class SysUserInfo extends BaseEntity {

    private String uname;

    private String upwd;

    private Integer sex;

    private Long onlineId;

    private Integer isAdmin;

    private Integer statusId;

    /**
     * 电子邮箱
     */
    @Email(message = "邮箱格式不正确！",groups = {ValidGroup.Add.class, Default.class})
    @NotBlank(message = "邮箱不能为空！",groups = {ValidGroup.Add.class, Default.class})
    private String email;

    /**
     * 手机号
     */
    @Pattern(regexp = Regex.Phone, message = "手机号格式不正确",groups = {ValidGroup.Add.class, Default.class})
    @NotBlank(message = "手机号不能为空！",groups = {ValidGroup.Add.class, Default.class})
    private String phone;

    private Integer status;

}
